
$(function() {
		// setup ul.tabs to work as tabs for each div directly under div.panes
		$("ul.tabs").tabs("div.panes > div");
	});
/*
jQuery(document).ready(function(){
	jQuery("#pull .toggle_container").hide();
	jQuery("#pull h2.trigger a").click(
		function(){
		jQuery(this).toggleClass("active");
		$("#pull .toggle_container").fadeToggle();
	    });
	
	});
*/
jQuery(document).ready(function(){
	    jQuery(".toggle_container").hide();
	     jQuery("h2.trigger").click(function(){
     			jQuery(this).toggleClass("active").next().toggle();
	    });
	});

$(document).ready(function(){
		$('.view-Promotions .view-content ul:first').attr('id','slider1');
		title = $('.view-Promotions .view-content div.views-field-title');
		title.addClass('toggle_container2');

		cont = $('.view-Promotions .view-content div.views-field-body');
		//cont.addClass('block2');
		cont.each(function() {
			title1 = $(this).closest("li").find(".views-field-title:first");
			title1.find("div:first").addClass('block2');
			titleHtml = title1.html();
			//title1.html(" ");
			$(this).appendTo( title1 );
			title1.find("div.views-field-body").prepend(titleHtml);
			title1.find("div.views-field-body").find("span:first");
			title1.find("div.views-field-body:first").addClass('block2');
			//title1.remove();
		});
		$('.right .toggle_container2 ').css("bottom","0");
		$('.right .toggle_container2 ').hide();
		
		//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
		//$(".right h2.trigger2").css("margin","10px");
		$(".right h2.trigger2").css("z-index","300000");
		$(".right h2.trigger2").css("position", "relative");
		$(".right h2.trigger2").click(function() {
			//alert(1);
			if ($(this).hasClass("active2")) $(this).removeClass("active2"); else $(this).addClass("active2");
			$('#slider1').data('AnythingSlider').startStop( !$(this).hasClass('active2') );
			$(this).closest("li").find(".toggle_container2").fadeToggle();
			return false; //Prevent the browser jump to the link anchor
		});

	});

$(function () {
		//$('#slider1').children().hide();
		//$('#slider1').find("li:first").show();
			$('#slider1').anythingSlider({
				width: 300,
				buildNavigation: false,
				autoPlay: true,
				startStopped: false,
				pauseOnHover: true,
				delay: 2000, // ms
				animationTime: 600, // ms
				buildArrows:true,
				easing: 'easeInOutExpo' 
			});
		});

$(function() {
			$( "#side" ).accordion({
				event: 'click',
				initShow : 'li.active-trail:last'
			});
			//$( "#side" ).accordion( "option", "navigation", true );
		});
		
		
$(function() {
	img = $("#pages .left .image-attach-body img:first");
	if (img.size()>0) {
		$("#pages .left .image-attach-body:first").hide();
		$(".promo_box_top img:first").attr("src", img.attr("src"));	
	}
});

$(function() {
	img = $("#news .left .image-attach-body img:first");
	if (img.size()>0) {
		$("#pages .left .image-attach-body:first").hide();
		$(".promo_box_top img:first").attr("src", img.attr("src"));	
	}
});
